import Router from "@koa/router";
const router = new Router({
  prefix: "/api",
});

import { getTopics, getTopic, postTopic, patchTopic, deleteTopic, getPosts, getPost, postPost, patchPost, deletePost, getComments, getComment, postComment, patchComment, deleteComment } from "../constroller/index.js";

router.get("/topics", getTopics);
router.get("/topics/:id", getTopic);
router.post("/topics", postTopic);
router.patch("/topics/:id", patchTopic);
router.delete("/topics/:id", deleteTopic);

router.get("/posts", getPosts);
router.get("/posts/:id", getPost);
router.post("/posts", postPost);
router.patch("/posts/:id", patchPost);
router.delete("/posts/:id", deletePost);

router.get("/comments", getComments);
router.get("/comments/:id", getComment);
router.post("/comments", postComment);
router.patch("/comments/:id", patchComment);
router.delete("/comments/:id", deleteComment);

export default router;
